<template>
  <div>
    <div class="last">
      <div class="top">
        <van-tabs v-model="active" color="#00a8ff">
          <van-tab title="精选"></van-tab>
          <van-tab title="华硕好屏"></van-tab>
          <van-tab title="游戏本"></van-tab>
          <van-tab title="ROG"></van-tab>
          <van-tab title="多彩a豆"></van-tab>
          <van-tab title="外设"></van-tab>
        </van-tabs>
      </div>
      <div class="banner">
        <div class="good" v-for="(v, index) in list" :key="index">
          <img :src="v.img1" alt=""  @click="obtn"/>
          <div class="wen">
            <span>{{ v.h1 }}</span>
            <p class="kk">{{ v.h2 }}</p>
            <div class="time">{{ v.huodong2 }}</div>
          </div>
          <div class="money">
            <span>{{ v.price }}</span>
            <p>{{ v.priceold }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import service from "../../utlis/request";
export default {
  data() {
    return {
      active: 2,
      list: "",
    };
  },
  mounted() {
    service({
      url: "http://localhost:3000/selected",
      method: "get",
    }).then((res) => {
      this.list = res.data[0].data.data1;
      console.log(res.data);
    });
  },
  methods:{
    obtn(){
     
        this.$router.push("/detailed/id");
        
    }
  }
};
</script>

<style scoped>
.last {
  width: 100%;
  height: 50rem;
}
.last .top {
  height: 2.8125rem;
}
.banner {
  margin: 10px;
  display: flex;
  justify-content: space-evenly;
  flex-flow: row wrap;
  width: 100%;
}

.banner .good {
  width: 47%;
  height: 300px;
  border: 1px solid gray;

  margin-top: 20px;
}
.banner .good img {
 width: 100%;
  height: 9.8125rem;
 
}
.good .wen {
  height: 74px;
}
.good .wen span {
  font-size: 16px;
}
.good .wen .kk {
  font-size: 9px;
}
.good .wen .time {
  height: 1.125rem;
  width: 38px;
  color: red;
}
.good .money {
  display: flex;
  height: 40px;
  line-height: 40px;
  margin-top: 19px;
}
.good .money span {
  color: red;
  font-size: 24px;
}
.good .money p {
  margin-left: 10px;
  font-size: 14px;
  text-decoration: line-through;
}
</style>